package com.asiainfo.dacp.datastash.broker.tracelog;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 *
 * 操作日志轨迹队列
 *
 * @author MeiKefu
 * @date 2017-11-30
 */
@Component
public class StashTraceLogFacade {

    @Autowired
    private RedisTemplate redisTemplate;

    private static final String BROKER_TRACE_LOG = "datastash:broker_trace_log_queue";//单元列表

    public StashTraceLogVo getStashTraceLogVo(){
        return (StashTraceLogVo)redisTemplate.opsForList().leftPop(BROKER_TRACE_LOG);
    }

    public void pushStashTraceLog(StashTraceLogVo logVo){
        redisTemplate.opsForList().rightPush(BROKER_TRACE_LOG,logVo);
    }

}
